/* 公共样式表 - 智慧粮仓系统样式 */

:root {
    /* 颜色系统 */
    --primary-bg: #0A2E5E;      /* 深蓝色背景 - 顶部 */
    --primary-bg-gradient: linear-gradient(to bottom, #0A2E5E, #0A4580); /* 蓝色背景渐变 */
    --secondary-bg: #0C3A71;    /* 稍亮的蓝色 */
    --primary-btn: #1389FF;     /* 蓝色按钮 */
    --primary-text: #FFFFFF;    /* 白色文字 */
    --secondary-text: rgba(255, 255, 255, 0.7); /* 次要文字 */
    --card-bg: rgba(11, 42, 96, 0.5); /* 卡片背景 */
    --card-border: rgba(255, 255, 255, 0.15); /* 卡片边框 */
    --status-normal: #34C759;   /* 绿色 - 正常状态 */
    --status-warning: #FF9500;  /* 橙色 - 警告状态 */
    --status-error: #FF3B30;    /* 红色 - 错误状态 */
    --header-height: 60px;      /* 导航栏高度 */
    --tab-height: 44px;         /* 选项卡高度 */
    --card-border-radius: 8px;  /* 卡片圆角 */
    --card-padding: 20px;       /* 卡片内边距 */
    --shadow-color: rgba(0, 0, 0, 0.3); /* 阴影颜色 */
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--primary-bg-gradient);
    color: var(--primary-text);
    height: 100vh;
    overflow: hidden;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* 公共头部样式 */
.common-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    padding: 0 20px;
    background-color: var(--primary-bg);
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
    width: 80px; /* 固定宽度，与JS中保持一致 */
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-link {
    color: var(--primary-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.back-link:hover {
    opacity: 0.8;
}

.back-link:active {
    transform: scale(0.95);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 200px; /* 固定宽度，与JS中保持一致 */
}

.date-time-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--primary-text);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-btn {
    background-color: var(--primary-btn);
    color: var(--primary-text);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.refresh-btn i {
    font-size: 16px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-icon-btn i {
    color: var(--primary-text);
    font-size: 18px;
}

.header-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.header-icon-btn:active {
    transform: scale(0.95);
}

/* 选项卡样式 */
.tab-container {
    display: flex;
    height: var(--tab-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 5;
}

.tab-item {
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    gap: 6px;
    height: 100%; /* Make tab-item height match tab-container height */
}

.tab-item i {
    font-size: 16px;
    opacity: 0.9;
}

.tab-item.active {
    color: var(--primary-text);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.05);
}

.tab-item.active i {
    color: var(--primary-btn);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-btn);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: var(--card-border-radius);
    border: 1px solid var(--card-border);
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--primary-text);
}

/* 主菜单图标样式 */
.menu-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.menu-icon i {
    font-size: 28px;
    color: var(--primary-text);
}

.menu-title {
    font-size: 15px;
    color: var(--primary-text);
    text-align: center;
}

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 46, 94, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-text);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast 容器 */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: auto;
    max-width: 90%;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    background-color: rgba(52, 199, 89, 0.9);
}

.toast.warning {
    background-color: rgba(255, 149, 0, 0.9);
}

.toast.error {
    background-color: rgba(255, 59, 48, 0.9);
}

.toast i {
    font-size: 18px;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* 数据显示样式 */
.data-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-text);
    margin: 5px 0;
}

.data-unit {
    font-size: 16px;
    font-weight: normal;
    color: var(--secondary-text);
    margin-left: 4px;
}

.data-label {
    font-size: 14px;
    color: var(--secondary-text);
    margin-bottom: 4px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 通用模态框样式 - 统一设计系统 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.modal[style*="display: flex"],
.modal.show {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    background: var(--theme-modal-bg) !important;
    border: 1px solid var(--theme-card-border) !important;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
    animation: modal-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

/* 针对不同主题的模态框背景优化 */
body .modal-content {
    background: var(--theme-modal-bg) !important;
}

body.theme-green .modal-content {
    background: var(--theme-modal-bg) !important;
}

body.theme-purple .modal-content {
    background: var(--theme-modal-bg) !important;
}

body.theme-orange .modal-content {
    background: var(--theme-modal-bg) !important;
}

body.theme-dark .modal-content {
    background: var(--theme-modal-bg) !important;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--theme-card-border) !important;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.2) !important;
    color: var(--theme-text-color) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

/* 针对不同主题的表单输入框背景优化 */
body .form-group input,
body .form-group select,
body .form-group textarea {
    background: rgba(0, 0, 0, 0.2) !important;
}

body.theme-dark .form-group input,
body.theme-dark .form-group select,
body.theme-dark .form-group textarea {
    background: rgba(0, 0, 0, 0.3) !important;
}

.modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--theme-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, 
                var(--theme-gradient-start) 0%, 
                var(--theme-gradient-end) 100%);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
                transparent 0%, 
                rgba(255, 255, 255, 0.3) 50%, 
                transparent 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--theme-text-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.close-modal {
    font-size: 24px;
    color: var(--theme-text-color);
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close-modal:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 28px;
    color: var(--theme-text-color);
    overflow-y: auto;
    max-height: calc(85vh - 160px);
    background: transparent;
}

.modal-footer {
    padding: 20px 28px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px solid var(--theme-card-border);
    background: transparent;
}

/* 通用表单样式 - 统一设计系统 */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--theme-text-color);
    font-size: 15px;
    opacity: 0.9;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--theme-gradient-start) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

/* 通用按钮样式 - 统一设计系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 52px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    box-shadow: var(--theme-card-shadow);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: var(--theme-text-color);
    border: 1px solid var(--theme-card-border);
}

.btn-primary:hover, .btn-primary:active {
    background: linear-gradient(135deg, var(--theme-gradient-end) 0%, var(--theme-gradient-start) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--theme-card-shadow);
}

.btn-secondary {
    background: var(--theme-card-bg);
    color: var(--theme-text-color);
    border: 1px solid var(--theme-card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover, .btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--theme-card-shadow);
}

.btn-danger {
    background-color: rgba(255, 59, 48, 0.8);
    color: white;
    border: 1px solid rgba(255, 59, 48, 0.8);
}

.btn-danger:hover, .btn-danger:active {
    background-color: rgba(255, 59, 48, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.btn-success {
    background-color: rgba(52, 199, 89, 0.8);
    color: white;
    border: 1px solid rgba(52, 199, 89, 0.8);
}

.btn-success:hover, .btn-success:active {
    background-color: rgba(52, 199, 89, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* 模态框中的按钮样式调整 */
.modal-footer .btn {
    min-width: 100px;
    height: 44px;
    font-size: 15px;
    padding: 0 20px;
    border-radius: 12px;
}

/* 小尺寸按钮 */
.btn-small {
    min-width: auto;
    height: 36px;
    font-size: 14px;
    padding: 0 16px;
    border-radius: 18px;
}

/* 确认对话框样式 */
.confirm-dialog .modal-body {
    text-align: center;
    padding: 32px 28px;
}

.confirm-dialog .modal-body p {
    font-size: 16px;
    margin: 0;
    color: var(--theme-text-color);
    opacity: 0.9;
}

.confirm-dialog .modal-footer {
    justify-content: center;
}

/* 表单验证样式 */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: rgba(255, 99, 71, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 99, 71, 0.2);
    background: rgba(255, 99, 71, 0.05);
}

.form-error {
    color: rgba(255, 99, 71, 0.9);
    font-size: 14px;
    margin-top: 6px;
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    .modal-header {
        padding: 20px 20px 16px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px 20px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* 自定义响应式样式 */
@media (max-width: 768px) {
    .common-header {
        padding: 0 16px;
    }
    
    .header-left {
        font-size: 16px;
        gap: 8px;
    }
    
    .header-center {
        display: none;
    }
    
    .refresh-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .tab-item {
        padding: 0 16px;
        font-size: 14px;
    }
}

@keyframes modal-appear {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='%23ffffff' d='M8 11.5L3.5 7h9z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 移除number类型输入框的上下箭头控件 */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    appearance: none;
    margin: 0; 
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 观察员角色样式 */
.disabled-for-viewer {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    position: relative;
}

.disabled-for-viewer::after {
    content: "🔒";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 按钮禁用状态保持颜色 */
button.disabled-for-viewer:disabled {
    background-color: inherit !important;
    color: inherit !important;
    border-color: inherit !important;
}

/* 通用分页组件样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    margin-top: 16px;
}

.pagination-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn i {
    font-size: 12px;
}

.pagination-page-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0 4px;
}

/* 紧凑型分页样式 */
.pagination-compact {
    padding: 8px 12px;
}

.pagination-compact .pagination-btn {
    padding: 3px 8px;
    font-size: 12px;
}

.pagination-compact .pagination-page-info,
.pagination-compact .pagination-info {
    font-size: 12px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
} 